<template>
	<view class="home">
		<swiper class="swiper" indicator-dots circular autoplay interval=3000>
			<swiper-item v-for="(item,index) in slides" :key="index">
				<image :src="item.url" style="width: 100%;"></image>
			</swiper-item>
		</swiper>
		<search v-model="msg"></search>
		<upload></upload>
	</view>
</template>

<script>
	import search from "../../components/search/search.vue"
	import upload from "../../components/upload/upload.vue"
	export default {
		data() {
			return {
				slides: [],
				msg:''
			}
		},
		onLoad() {
			this.getSwiper()
			// this.showSearch()
		},
		components:{
			upload,
			search
		},
		methods: {
			async getSwiper() {
				const res = await this.$myRequest({
					url: "getImage/getSwiper"
				})
				// console.log(res.data)
				this.slides = res.data
			}
			
		}
	}
</script>

<style>
	.swiper{
		margin-bottom: 20px;
	}

</style>
